#ifndef __GZ_INTERFACE_PARAM_CLIENT_H__
#define __GZ_INTERFACE_PARAM_CLIENT_H__

#include <string>
#include <functional>

namespace Gazella {

//response
typedef std::function<void(bool, const std::string&)> param_response_callback_t;

class GzParamClient {
public:
    GzParamClient();
    ~GzParamClient();

    //async call param
    [[deprecated]]
    static int param_request(
        const std::string& service_name, //service name to request
        const std::string& if_name, //param interface name to request
        const std::string& request_payload, //param request payload, user defined
        param_response_callback_t callback, //param response callback (it will be called by threadpool)

        uint32_t timeout = 3,

        //if loadbalance == false
        //set host_ip and pod_ip uniquely specify a service
        bool loadbalance = true,
        const std::string& service_uuid = "",

        //traceid to follow call route 
        const std::string& traceid = "",
        //call transmission priority
        uint32_t priority = 0
    );

    //sync call service
    [[deprecated]]
    static std::string param_request (
        const std::string& service_name,
        const std::string& if_name,
        const std::string& request_payload,

        uint32_t timeout = 3,

        //if loadbalance == false
        //set host_ip and pod_ip uniquely specify a service
        bool loadbalance = true,
        const std::string& service_uuid = "",

        //traceid to follow call route 
        const std::string& traceid = "",
        //call transmission priority
        uint32_t priority = 0
    );

    //async param get(kv pair)
    static int param_get(
        const std::string& service_name, //service name to request
        const std::string& if_name, //param interface name to request
        const std::string& key, //param key to get 
        param_response_callback_t callback, //param response callback (it will be called by threadpool)

        uint32_t timeout = 3,

        //if loadbalance == false
        //set host_ip and pod_ip uniquely specify a service
        bool loadbalance = true,
        const std::string& service_uuid = "",

        //traceid to follow call route 
        const std::string& traceid = "",
        //call transmission priority
        uint32_t priority = 0
    );

    //sync param get(kv pair) 
    static std::string param_get (
        const std::string& service_name,
        const std::string& if_name,
        const std::string& key, 

        uint32_t timeout = 3,

        //if loadbalance == false
        //set host_ip and pod_ip uniquely specify a service
        bool loadbalance = true,
        const std::string& service_uuid = "",

        //traceid to follow call route 
        const std::string& traceid = "",
        //call transmission priority
        uint32_t priority = 0
    );

    //async param set(kv pair)
    static int param_set(
        const std::string& service_name, //service name to request
        const std::string& if_name, //param interface name to request
        const std::string& key, //param key to set 
        const std::string& value, //param value to set 
        param_response_callback_t callback, //param response callback (it will be called by threadpool)

        uint32_t timeout = 3,

        //if loadbalance == false
        //set host_ip and pod_ip uniquely specify a service
        bool loadbalance = true,
        const std::string& service_uuid = "",

        //traceid to follow call route 
        const std::string& traceid = "",
        //call transmission priority
        uint32_t priority = 0
    );

    //sync param set(kv pair) 
    static bool param_set (
        const std::string& service_name,
        const std::string& if_name,
        const std::string& key, 
        const std::string& value, 

        uint32_t timeout = 3,

        //if loadbalance == false
        //set host_ip and pod_ip uniquely specify a service
        bool loadbalance = true,
        const std::string& service_uuid = "",

        //traceid to follow call route 
        const std::string& traceid = "",
        //call transmission priority
        uint32_t priority = 0
    );
};
} //namespace Gazella

#endif